home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 March / 1994-03b.d64 / batch util (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  69 lines

  1. 10 data 000,037,147,049,140,048,146,056
  2. 20 data 055,148,048,130,057,057,057,031
  3. 30 ifpeek(124)=76andpeek(126)=192thenpoke127,0
  4. 35 open15,8,15,"u9":open1,0:poke53280,11:poke53281,0
  5. 40 n$="":n1$="":n2$=""
  6. 50 print"[147][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  7. 60 print" batch utilities"
  8. 70 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"
  9. 80 print"select:"
  10. 90 print" 1- find error"
  11. 100 print" 2- convert seq to speedscript"
  12. 110 print" 3- print seq file"
  13. 120 print" 4- make empty file"
  14. 130 print" 5- exit program"
  15. 140 geti$:a=val(i$):ifa<1ora>5then140
  16. 150 onagoto180,340,490,590:print"[147]";
  17. 160 close1:close2:close3:close15:clr
  18. 170 end
  19. 180 print"[147] ** find error **"
  20. 190 input"filename";n$:ifn$=""then40
  21. 200 e=peek(50997)+256*peek(50998):e$=""
  22. 210 e=e/4096:fori=1to4:a=int(e):e$=e$+chr$(48+a-(a>9)*7)
  23. 220 e=16*(e-a):next
  24. 230 print"location? $";e$;"[157][157][157][157]";
  25. 240 input#1,e$:iflen(e$)<>4ore$="0000"then40
  26. 250 e=0:fori=1to4:a=asc(e$):a=a-48+(a>64)*7:e$=mid$(e$,2)
  27. 260 e=16*e+a:next:print"[147]":c=0
  28. 270 open2,8,2,"0:"+n$+",s,r":gosub1000
  29. 280 get#2,i$:a=st:c=c+1:ifi$=chr$(13)theni$="_"+i$
  30. 290 ifc>ethenpoke199,1
  31. 295 getj$:ifj$=" "thenpoke198,0:wait198,1:getj$
  32. 300 ifj$=chr$(13)thena=1
  33. 310 printi$;:ifa=0then280
  34. 320 close2:print:print" press a key"
  35. 330 wait198,15:poke198,0:goto40
  36. 340 print"[147] ** convert seq to speedscript **"
  37. 350 input"source file";n1$:ifn1$=""then40
  38. 360 input"output file";n2$:ifn2$=""then40
  39. 370 open2,8,2,"0:"+n1$+",s,r":gosub1000
  40. 390 open3,8,3,"0:"+n2$+",p,w":gosub1000
  41. 400 restore:fori=1to16:reada
  42. 410 print#3,chr$(a);:next:print"[147]"
  43. 420 get#2,i$:a=st:j$=i$:ifj$=chr$(13)thenj$="_"
  44. 430 printj$;:poke783,1:sys65520:x=peek(782)+40*(peek(782)>39):y=peek(781)
  45. 440 i=peek(1023+x+y*40):print#3,chr$(i);:i=st
  46. 450 ifi$=chr$(13)thenprint
  47. 460 ifithengosub1000
  48. 470 ifa=0then420
  49. 480 print#3,chr$(146);chr$(48);:close2:close3:goto40
  50. 490 print"[147] ** print seq file **"
  51. 500 input"filename";n$:ifn$=""then40
  52. 510 print"print to device# 4[157]";:input#1,d:ifd=0then40
  53. 520 open2,8,2,"0:"+n$+",s,r":gosub1000:open3,d:l=0:p=1:print"[147]"
  54. 530 ifl=0thenprint#3,chr$(14);n$,"page";p;chr$(15):print#3:l=2
  55. 540 get#2,i$:a=st:ifi$=chr$(13)theni$="_"+i$:l=l+1
  56. 550 print#3,i$;
  57. 560 ifl=62thenfori=1to4:print#3:next:l=0:p=p+1
  58. 570 ifa=0then530
  59. 580 close2:print#3:close3:goto40
  60. 590 print"[147] ** make empty file **"
  61. 600 input"filename";n$:ifn$=""then40
  62. 610 open2,8,2,"0:"+n$+",p,w":gosub1000
  63. 620 restore:fori=0to15:reada:print#2,chr$(a);:next
  64. 630 close2:goto40
  65. 1000 ds$=""
  66. 1010 get#15,b$:ds$=ds$+b$:ifb$<>chr$(13)then1010
  67. 1020 ifleft$(ds$,2)="00"thenreturn
  68. 1030 print"[147]error:[146] ";ds$:goto160
  69.